<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.gzgi.framework.*"%>
<%@ page import="com.gzgi.framework.util.*"%>
<%@ page import="com.gzgi.framework.context.*"%>
<%@ include file="/pages/system/checkAdmin.jsp"%>
<%
		Connection con = null;
        PreparedStatement psmt = null;
		ResultSet rs = null;
		List rows = new ArrayList();
		try {
			    con = ContextFactory.getConnection();
			    Statement stmt = con.createStatement();
			    rs = stmt.executeQuery("select ID_, LISTLINK_ from SYS_TODO ");
				while(rs.next()){
					long todoId = rs.getLong(1);
					String link = rs.getString(2);
					link = StringTools.replaceIgnoreCase(link, "taskType=running", "taskType=all");
				    psmt = con.prepareStatement(" update SYS_TODO set ALLLISTLINK_ = ? where ID_ = ?  ");
					psmt.setString(1, link);
					psmt.setLong(2, todoId);
				    psmt.executeUpdate();
				    psmt.close();
					psmt = null;
				}

			  rs.close();
			  stmt.close();
			
			  out.println("<br><div align=center>Commond OK</div><br>");

		} catch (Exception ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex.getMessage());
		} finally{
			try {
				if (con != null && !con.isClosed()) {
					con.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}
	
%>